 let myFun = {
  dateFormat:(dataStr,ti)=>{
    if(dataStr===undefined || dataStr===null)return '--';
    let time = new Date(Number(dataStr));
    function timeAdd0(str) {
      if(str<10){
        str='0'+str;
      }
      return str
    }
    let y = time.getFullYear();
    let m = time.getMonth()+1;
    let d = time.getDate();
    let h = time.getHours();
    let mm = time.getMinutes();
    let s = time.getSeconds();
    if(ti===1){
      return y+'年'+timeAdd0(m)+'月'+timeAdd0(d)+'日 '+timeAdd0(h)+':'+timeAdd0(mm);
    }else if(ti===2){
      return y+'-'+timeAdd0(m)+'-'+timeAdd0(d)
    }else {
      return y+'年'+timeAdd0(m)+'月'+timeAdd0(d)+'日';
    }
  },
  // 返回的空字符串用 -- 代替
  isNull:str=>{
    if(str===undefined || str===null){
      return '--'
    }else {
      return str
    }
  }
};
export default {
  myFun
}
